import request from '../utils/request.js'

export const code2session = function( data ) {
	return request( {
		url: `/miniapp/jscode2session?code=${data.code}`,
		method: 'POST',
		data
	} )
}

export const getOpenIdH5 = function( data ) {
	return request( {
		url: `/mp/oauth2getAccessToken?code=${data.code}`,
		method: 'GET',
		data
	} )
}

export const sendSubMessage = function( data ) {
	return request( {
		url: `/miniapp/sendMaMessage`,
		method: 'POST',
		data
	} )
}